import request from '@/utils/request'
export function addOrUpdateTaskSignIn(params) {
    return request({
        url: window.CONFIG.restIp + '/sso/ews',
        method: 'post',
        headers: {
            'psecurity-target': 'addOrUpdateTaskSignIn',
            'tenantId': readCookie('tenantId'),
            'userId': readCookie('userId')
        },
        data: params
    })
}

export function getTaskSignInByProcessInstanceId(id) {
    return request({
        url: window.CONFIG.restIp + '/sso/ews',
        method: 'post',
        headers: {
            'psecurity-target': 'getTaskSignInByProcessInstanceId',
            'tenantId': readCookie('tenantId'),
            'userId': readCookie('userId')
        },
        data: {
            'id': id
        }
    })
}
export function getProductModelList (params) {
  return request({
    url: window.CONFIG.restIp + '/sso/ews',
    method: 'post',
    headers: {
      'psecurity-target': 'getProductModelList',
      'tenantId': readCookie('tenantId'),
      'userId': readCookie('userId')
  },
    data:params

  })
}
function readCookie(name) {
    var arr = document.cookie.match(new RegExp('(^| )' + name + '=([^;]*)(;|$)'))
    if (arr != null) return unescape(arr[2])
    return false
}
